package com.hjw.weixun.service.impl;

import java.util.List;

import com.hjw.weixun.dao.MessageDao;
import com.hjw.weixun.dao.impl.MessageDaoJdbcImpl;
import com.hjw.weixun.domain.Message;
import com.hjw.weixun.domain.Weixun;
import com.hjw.weixun.service.MessageService;

/**
 * 
 * @author wangchangxin
 */
public class MessageServiceImpl implements MessageService {

	// MessageDao
	private MessageDao messageDao = MessageDaoJdbcImpl.getInstance();

	public static MessageService messageService;

	// 单例
	public static MessageService getInstance() {
		if (messageService == null) {
			messageService = new MessageServiceImpl();
		}
		return messageService;
	}

	@Override
	public int addMessage(Message message) {
		return messageDao.addMessage(message);		
	}

	@Override
	public Message getMessage(Message message) {
		return messageDao.getMessage(message);
	}

	@Override
	public List<Message> getMessageList(Weixun weixun) {
		
		return messageDao.getMessageList(weixun);
	}
	
	

	

}
